using System;
using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class Anima_move : MonoBehaviour //史莱姆的移动动画表现;
{
    public GameObject NextContainer;//下一个器皿
    public float MoveSpeed;
    private Vector3 Direction;
    
    // Start is called before the first frame update
    private void Awake()
    {   
        Direction = NextContainer.transform.position - transform.position;
    }

    // Update is called once per frame
    void Update()
    {
        Move();
    }

    void Move()
    {
        if (transform.position.x < NextContainer.transform.position.x)
        {
            
            transform.position += Direction * MoveSpeed * Time.deltaTime;
        }
    }


}
